package a01threadcase3;

import java.util.concurrent.Callable;

/**
 * ClassName:    MyCallable
 * Description:  Callable接口的实现类
 * Author:       于子续
 * Date:         2024/10/10 下午3:12
 * Version:      1.0
 **/
public class MyCallable implements Callable<Integer> {

    @Override
    public Integer call() throws Exception {
        //求1~100之间的和
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum = sum + i;
        }
        return sum;
    }
}
